package singleton.demo1;

/**
 * 懒汉模式
 * 有线程安全问题
 * 无法在多线程的情况下实现单例
 */
public class XieFactory {

    private static XieFactory factory;

    private String name = "江南鞋厂";

    private XieFactory() {
    }

    public static XieFactory getInstance(){
        if (factory == null) {
            factory = new XieFactory();
        }

        return factory;
    }
}
